<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="css/createnovel.css" rel="stylesheet" type="text/css" />
  <title>创建小说</title>
  <script type="text/javascript" src="js/jquery.min.js"></script>   
    <script language="javascript" type="text/javascript" src="js/lib/My97DatePicker/WdatePicker.js"></script>   
    <script type="text/javascript" src="js/ajaxfileupload.js"></script>
  <script type="text/javascript">
    $(function () {
      $("input") //将html控件实现jqury对象化  
      $("#btnupload").click(function () {
        $("#fileToUpload").click();
      });
      //选择文件之后执行上传  
      $("#fileToUpload").change(function () {

        $.ajaxFileUpload({
          url: 'path=' + $("#").val(),
          type: "post",
          secureuri: false,
          fileElementId: 'fileToUpload',//file标签的id  
          dataType: 'json',//返回数据的类型  
          data: { "titleid": "" },//一同上传的数据  
          success: function (data) {
            //把图片替换 
            alert(data.result2);
            $("#upload").attr("src", "/upload1/" + data.result2);  //将图片路径传给<img 
            //将返回值中的文件相对路径及名称写入到文本框中 
            $("#photoname").val(data.result1); //将资源码传给 <input
            alert(data.error_msg);
          },
          error: function (data, status, e) {
            alert(e);
          }
        });
      });

    });  
  </script>
</head>

<body>
  <div id="main">
    <div id="topic">
      <span>创建小说</span>
    </div>

    <form method="post" name="newcreatenovel" action="#">

      <input name="titleid" type="text" size="50" value="15" style="display:none" />

      <table width="90%">
        <tr>
          <td colspan="2" class="menu"><a href="#">《返回作者主页</a> </td> </tr> <tr>
          <td colspan="2" class="topicdescrib">填写要发表小说的基本信息</td>
        </tr>
        <tr>
          <td class="label">小说标题：</td>
          <td class="controlbox">
            <textarea name="topic" cols="80" rows="2" style="resize:none">""</textarea>
          </td>
        </tr>
        <tr>
          <td class="label">小说分类:</td>
          <td class="controlbox">
            <input name="querykey" type="text" size="50" value="" />
          </td>
        </tr>
        <tr>
          <td class="label">小说简介:</td>
          <td class="controlbox">
            <input name="area" type="text" size="50" value="" />
          </td>
        </tr>
        <tr>
          <td class="label">小说封面:</td>
          <td class="controlbox">
            <input id="btnupload" class="btnphoto" name="btnaddphoto" type="button" value="上传小说封面" />
            <input id="fileToUpload" style="display:none" type="file" name="upfile" />
            <img id="upload" src="" width="100px" height="100px" />
          </td>
          >
        </tr>
        <tr>
          <td colspan="2" style="height:45px; text-align:center">
            <input name="submit" type="submit" value="保存更新" style="font-size:18px;font-weight:500;" />
          </td>
        </tr>
      </table>
    </form>

  </div>
  <div class="copyright">
    <p style="color:#6E727D">Copyright © 2019 - Software Technology from <a href="http://www.yngsxy.net/" title="云南工商学院"
        target="_blank">云南工商学院</a></p>
  </div>
</body>
<script>


</script>

</html>